export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "设备编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "设备名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_equipmentType",
          title: {
            "zh-CN": "类别名称",
            "en-US": "equipment type",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          config: {
            type: "select",
            options: this.filterEquipTypeOptions,
            disabled: true,
          },
          render: (h, params) => {
            return h(
              "div",
              {},
              this.getOptionValue(
                this.filterEquipTypeOptions,
                params.row.sf_equipmentType
              )
            );
          },
        },
        {
          key: "equipmentPower",
          title: {
            "zh-CN": "设备功率(kw/h)",
            "en-US": "equipment power",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "bf_energyShow",
          title: {
            "zh-CN": "能源展示",
            "en-US": "bf_energyShow",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.energyShowOptions, params.row.bf_energyShow))
          }
        },
        {
          key: "sf_store",
          title: {
            "zh-CN": "仓库",
            "en-US": "sf_store",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.storeOptions, params.row.sf_store))
          }
        },
        {
          key: "emptyLocation",
          title: {
            "zh-CN": "上料空桶库位",
            "en-US": "emptyLocation",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.allWarehouseOptions, params.row.emptyLocation))
          }
        },
        {
          key: "fillLocation",
          title: {
            "zh-CN": "上料满桶库位",
            "en-US": "fillLocation",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.allWarehouseOptions, params.row.fillLocation))
          }
        },
        {
          key: "downLocation",
          title: {
            "zh-CN": "下料空桶库位",
            "en-US": "downLocation",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.allWarehouseOptions, params.row.downLocation))
          }
        },
        {
          key: "downFillLocation",
          title: {
            "zh-CN": "下料满桶库位",
            "en-US": "downFillLocation",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.allWarehouseOptions, params.row.downFillLocation))
          }
        },
        {
          key: "workshop",
          title: {
            "zh-CN": "责任车间",
            "en-US": "workshop",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_workshopSection",
          title: {
            "zh-CN": "所属工段",
            "en-US": "sf_workshopSection",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "procedure",
          title: {
            "zh-CN": "默认工序",
            "en-US": "procedure",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "prodSpec",
          title: {
            "zh-CN": "生产规格",
            "en-US": "prodSpec",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "manufacturer",
          title: {
            "zh-CN": "设备厂商",
            "en-US": "manufacturer",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "purchaseDate",
          title: {
            "zh-CN": "采购日期",
            "en-US": "purchaseDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "arrivalDate",
          title: {
            "zh-CN": "到厂日期",
            "en-US": "arrivalDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "responsible",
          title: {
            "zh-CN": "负责人",
            "en-US": "responsible",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "workHours",
          title: {
            "zh-CN": "标准工时",
            "en-US": "workHours",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "maintenancePeriod",
          title: {
            "zh-CN": "保养周期",
            "en-US": "maintenance period",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "specifyDate",
          title: {
            "zh-CN": "指定日期",
            "en-US": "specifyDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "endDate",
          title: {
            "zh-CN": "结束日期",
            "en-US": "endDate",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "设备编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "设备名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_equipmentType",
          title: {
            "zh-CN": "类别名称",
            "en-US": "equipment type",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.filterEquipTypeOptions },
        },
        {
          key: "equipmentPower",
          title: {
            "zh-CN": "设备功率(kw/h)",
            "en-US": "equipment power",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "bf_energyShow",
          title: {
            "zh-CN": "能源展示",
            "en-US": "bf_energyShow",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.energyShowOptions },
        },
        {
          key: "sf_store",
          title: {
            "zh-CN": "仓库",
            "en-US": "sf_store",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.storeOptions },
        },
        {
          key: "emptyLocation",
          title: {
            "zh-CN": "上料空桶库位",
            "en-US": "emptyLocation",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.locationOptions },
        },
        {
          key: "fillLocation",
          title: {
            "zh-CN": "上料满桶库位",
            "en-US": "fillLocation",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "multiSelect", options: this.locationOptions },
        },
        {
          key: "downLocation",
          title: {
            "zh-CN": "下料空桶库位",
            "en-US": "downLocation",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.locationOptions },
        },
        {
          key: "downFillLocation",
          title: {
            "zh-CN": "下料满桶库位",
            "en-US": "downFillLocation",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "select", options: this.locationOptions },
        },
        {
          key: "workshop",
          title: {
            "zh-CN": "责任车间",
            "en-US": "workshop",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: [{ label: '中粗粉车间', value: '中粗粉车间' }, { label: '超细粉车间', value: '超细粉车间' }, { label: '气体站', value: '气体站' }] },
        },
        {
          key: "sf_workshopSection",
          title: {
            "zh-CN": "所属工段",
            "en-US": "sf_workshopSection",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: [{ label: '还原', value: '还原' }, { label: '配碳', value: '配碳' }, { label: '碳化破碎', value: '碳化破碎' }, { label: '合批', value: '合批' }, { label: '筛分', value: '筛分' }] },
        },
        {
          key: "procedure",
          title: {
            "zh-CN": "默认工序",
            "en-US": "procedure",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "prodSpec",
          title: {
            "zh-CN": "生产规格",
            "en-US": "prodSpec",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "manufacturer",
          title: {
            "zh-CN": "设备厂商",
            "en-US": "manufacturer",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "purchaseDate",
          title: {
            "zh-CN": "采购日期",
            "en-US": "purchaseDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "arrivalDate",
          title: {
            "zh-CN": "到厂日期",
            "en-US": "arrivalDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "responsible",
          title: {
            "zh-CN": "负责人",
            "en-US": "responsible",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "workHours",
          title: {
            "zh-CN": "标准工时",
            "en-US": "workHours",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "maintenancePeriod",
          title: {
            "zh-CN": "保养周期",
            "en-US": "maintenance period",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "specifyDate",
          title: {
            "zh-CN": "指定日期",
            "en-US": "specifyDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "endDate",
          title: {
            "zh-CN": "结束日期",
            "en-US": "endDate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "date" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "设备编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "设备名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_workshopSection",
          title: {
            "zh-CN": "所属工段",
            "en-US": "sf_workshopSection",
          }[this.G_Locale],
          config: { type: 'select', options: [{ label: '还原', value: '还原' }, { label: '配碳', value: '配碳' }, { label: '碳化破碎', value: '碳化破碎' }, { label: '合批', value: '合批' }, { label: '筛分', value: '筛分' }] },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "设备编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "设备名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_workshopSection",
          title: {
            "zh-CN": "所属工段",
            "en-US": "sf_workshopSection",
          }[this.G_Locale],
          config: { type: 'select', options: [{ label: '还原', value: '还原' }, { label: '配碳', value: '配碳' }, { label: '碳化破碎', value: '碳化破碎' }, { label: '合批', value: '合批' }, { label: '筛分', value: '筛分' }] },
        },
      ];
    },
    paramSelectColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "参数编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "参数名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
      ];
    },
    paramSelectMormColumns() {
      return {
        type: "expand",
        slot: "expand",
        width: 40,
        render: (h, params) => {
          return h("div", [
            h("div", `${this.lang["status"]}:${params.row.status}`),
          ]);
        },
      };
    },
    paramSelectFormColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "参数编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "参数名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
          status: "status",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
          status: "状态",
        },
      }[this.G_Locale];
    },
  },
};
